package yartiss.engine.simulation.system;

import java.util.List;
import java.util.SortedSet;

public interface ITaskSet extends Iterable<ITask> {

	/**
	 * Add a task to the task set
	 * 
	 * @param t
	 *            the task to add
	 * @return false if the task cannot be added (already a task with this
	 *         priority in the task set)
	 */
	public boolean addTask(ITask t);

	/**
	 * return a subset containing active tasks, ordered consistently with the
	 * scheduling policy used. Note that the ordering may be inconsistent with
	 * Task.equals();
	 * 
	 * @return the active tasks
	 */
	public SortedSet<ITask> getActiveTasks(long date);

	public int getAllTasksCount();

	public SortedSet<ITask> getHeadSet(ITask task, boolean inclusive);

	public int getId();

	int setId(int id);

	public ITask getOne();

	boolean addTasks(List<ITask> t);
	
	public ITaskSet cloneTaskSet();

}
